package edu.famework.demoZ1.answer;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        List<Student> list = new ArrayList<>();
        for(int i = 0;i<3;i++) {
            System.out.println("请输入学号");
            int sid = input.nextInt();
            System.out.println("请输入名称");
            String name = input.next();
            System.out.println("请输入密码");
            String password = input.next();
            System.out.println("请输入年龄");
            int age = input.nextInt();
            System.out.println("请输入住址");
            String address = input.next();
            //创建学生对象
            Student student = new Student();
            student.setSid(sid);
            student.setName(name);
            student.setPassword(password);
            student.setAge(age);
            student.setAddress(address);
            //将学生对象保存到集合中
            list.add(student);
        }
        //调用Manager对象中的方法
        Manager manager = new Manager();
        manager.writeFile(list);
    }
}
